## This software is licensed by the MIT License, see LICENSE file ##
##                                    Copyright © 2022 whitemangl ##

import asyncio
from aiogram.types import Message

from utils import TGPBot

async def __on_admin_message(message: Message, bot: TGPBot):
    if message.text == "/kill":
        await bot.__on_shutdown__(bot)
        await message.delete()
        exit(0)
    else: await bot.send_sys_message("Неизвестная команда")

async def __on_ignore(message: Message, bot: TGPBot):
    await asyncio.sleep(0)

async def on_message(message: Message, bot: TGPBot):
    if   message.chat.id == int(bot.admin_id): await __on_admin_message(message, bot)
    else: await __on_ignore(message, bot)
